package 设计模式.segregation;

public class Segregation1 {
    public static void main(String[] args) {

    }
}


interface Interfacel{
    void operation1();
    void operation2();
    void operation3();
    void operation4();
    void operation5();
}
class B implements Interfacel{
    public void operation1(){
        System.out.println("B实现了1");
    }
    public void operation2(){
        System.out.println("B实现了2");
    }
    public void operation3(){
        System.out.println("B实现了3");
    }
    public void operation4(){
        System.out.println("B实现了4");
    }
    public void operation5(){
        System.out.println("B实现了6");
    }
}

class D implements Interfacel{
    public void operation1(){
        System.out.println("B实现了1");
    }
    public void operation2(){
        System.out.println("B实现了2");
    }
    public void operation3(){
        System.out.println("B实现了3");
    }
    public void operation4(){
        System.out.println("B实现了4");
    }
    public void operation5(){
        System.out.println("B实现了6");
    }
}

//A依赖B使用1、2、3方法
class A{
    public void depend1(Interfacel i){
        i.operation1();
    }
    public void depend2(Interfacel i){
        i.operation2();
    }
    public void depend3(Interfacel i){
        i.operation3();
    }
}

//C依赖D使用1、4、5方法
class C{
    public void depend1(Interfacel i){
        i.operation1();
    }
    public void depend2(Interfacel i){
        i.operation4();
    }
    public void depend3(Interfacel i){
        i.operation5();
    }
}